﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccessLayer
{
    public class RoleData
    {

        StationeryInventoryEntities1 ent;
        
        public RoleData()
        {
            ent = new StationeryInventoryEntities1();
        }

        public Role GetRoleByRoleID(int roleId){            
            Role role = new Role();
            
            var r = ent.Roles.FirstOrDefault(x => x.RoleID == roleId);
            
            if (r != null)
            {
                role.RoleID = r.RoleID;
                role.RoleName = r.RoleName;
            }

            return r;
        }

    }
}
